<template>
  <div>
      <h3>孙组件{{money}}</h3>
      <button @click="getmoney(50)">花掉50</button>
  </div>
</template>

<script>
import { inject } from 'vue'
export default {
    setup(){

        const money = inject('money')
        const getmoney = inject('getmoney')
        // const fn = ()=>{
        //     getmoney(50)
        // }

        return {money,getmoney}
    }
}
</script>

<style>

</style>